<html><head><title>ArraySize</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="4">ArraySize()</font></b></p>
<p><b>Syntax</b></p><blockquote>
Result = <font color="#006666"><b>ArraySize</b></font>(Array() [, Dimension])</blockquote>

<b>Description</b><br><blockquote>

Returns the size of the array, as specified with <b><font color="#006666">Dim</font></b> or <b><font color="#006666">ReDim</font></b>. 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>Array()</i></td>
<td width="90%"> 
The array to get the size from. 

</td></tr>
<tr><td><i>Dimension (optional)</i></td>
<td> 
For multidimensional arrays, this parameter can be specified to get a specific dimension size. 
The first dimension starts from 1. 

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>

Returns the size of the array dimension. 
If the array isn't yet declared (or its allocation has failed), it will return -1. 

</blockquote><p><b>Example</b></p><blockquote>


<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#006666">Dim</font></b> <font color="#006666">MyArray</font>.l(10)
  <b><font color="#006666">Debug</font></b> <font color="#006666">ArraySize</font>(<font color="#006666">MyArray</font>()) <font color="#006666">; will print '10'</font>

  <b><font color="#006666">Dim</font></b> <font color="#006666">MultiArray</font>.l(10, 20, 30)
  <b><font color="#006666">Debug</font></b> <font color="#006666">ArraySize</font>(<font color="#006666">MultiArray</font>(), 2) <font color="#006666">; will print '20'</font>
</font></pre>

</blockquote><p><b>Example</b></p><blockquote>


<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#006666">Dim</font></b> <font color="#006666">Test</font>.q(99999999999999999)
  
  <b><font color="#006666">If</font></b> <font color="#006666">ArraySize</font>(<font color="#006666">Test</font>()) &#060;&#062; -1
<font color="#006666">    Test</font>(12345) = 123  <font color="#006666">; everything fine</font>
  <b><font color="#006666">Else</font></b>
    <b><font color="#006666">Debug</font></b> "Array 'Test()' couldn't be initialized."
  <b><font color="#006666">EndIf</font></b>
</font></pre>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="../list/listsize.html">ListSize()</a>, <a href="../map/mapsize.html">MapSize()</a> 

</Blockquote><p><b>Supported OS </b><Blockquote>All</Blockquote></p><center><a href=index.html>Array Index</a> - <a href=copyarray.html>CopyArray()</a> ->

</body></html>